<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
     <div>
        第一题
    </div>
    <script>
         //2299713201陈柏江
        (function ()
        {
            
        function getSum(num1,num2)
        {
            var num1;
            var num2;
            console.log(num1+'*'+num2+'='+(num1*num2));
        }
        console.log(getSum(5,5));
    })();
    
    </script> 
     <div>
        第二题
    </div>
    <script>
         //2299713201陈柏江
        (function()
        {
         
        let getProduct=function(num1,num2)
        {
           return num1+"*"+num2+"="+num1*num2;
        }  
       console.log( getProduct(2,4));
     })();
    </script>
    <<div>
        第三题
    </div>
   <script>
     //2299713201陈柏江
    (function()
    {
        var a=100;
        function test()
            {
                console.log(a);
                a=10;
                console.log(a);
            }
            test();
            console.log(a);
    })();
   </script>

    <div>
       第四题
    </div>
    <script>
    //2299713201陈柏江
    (function()
    {
      var a=10;
      fun1();
      function fun1(){
        var b=20;
        console.log(a);
        console.log(b);
        var a=30;
      }
    })();
    </script>

<div>第五题：</div>
   <script>
   //2299713201陈柏江
            function fun2(a,b){
            console.log(arguments[0]);
             console.log(arguments[1]);
             console.log(arguments[2]);
         }
         fun2(1,2,3);
     </script>

     <div>第六题：</div>
     <script>
         function fun2() {
         for (var key in arguments) {
         if (typeof arguments[key] !== 'number') continue; // 过滤非数字参数
        console.log(arguments[key]);
        }
         }
         fun2(1, 2, 3);
         </script>


         <div>第七题：</div>
         <script>
 //2299713201陈柏江
         num=100;   //---错误原因：未对num进行定义。
     </script>

     <div>第八-九题：</div>
     <script>
    //2299713201陈柏江
        try {
         const num = 10;
         num();  //---尝试将一个数字作为函数调用
         } 
         catch (error) {
         console.log('捕获到类型错误：', error.message);
         }
        </script>
</body>
</html>